const arguments to member functions

In previous versions , it was possible to convert, or "widen", a pointer to a const object into a pointer to a non-const object by adding the const object to a collection class and then removing it:

Object* f(const Object& co)

{

OrderedCltn c;

c.add(co);

return c.remove(co);

}

C++ R2.0 now issues error or warning messages when a const pointer is converted into a non-const pointer. To eliminate these problems, the const arguments to some functions such as add() have been changed to non-const arguments. These changes affect classes Assoc, LinkOb, and the collection classes.

If you need to add a const object to a collection class, you must use an explicit cast:

c.add((Object&)co);